package com.hhf.springboot.service;

import dev.langchain4j.model.openai.OpenAiChatModel;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;


/**
 * @Author hhf
 * @Date 2025/3/25
 * @Description 测试LLM大模型
 */
@SpringBootTest
@Slf4j
public class ChatService {

    @Test
    void testHelloChat(){
        OpenAiChatModel model = OpenAiChatModel.builder().apiKey("demo").modelName("gpt-4o-mini").build();
        String answer = model.generate("你好,你是谁?");

        log.info(answer);

    }


}
